<?php
/**
 * PHP-Ext Library
 * http://php-ext.googlecode.com
 * @author Sergei Walter <sergeiw[at]gmail[dot]com>
 * @copyright 2008 Sergei Walter
 * @license http://www.gnu.org/licenses/lgpl.html
 * @link http://php-ext.googlecode.com
 * 
 * Reference for Ex JS: http://extjs.com
 * 
 */

/**
 * @see PhpExt_Toolbar_Toolbar
 */
include_once 'PhpExt/Toolbar/Item.php';


/**
 * A specialized toolbar that is bound to a Ext.data.Store and provides automatic paging controls.
 * @package PhpExt
 * @subpackage Toolbar
 */
class PhpExt_Toolbar_MenuButton extends PhpExt_Toolbar_Item 
{	
    // DisplayInfo
    /**
     * True to display the displayMsg (defaults to false)
     * @param string $value 
     * @return PhpExt_Toolbar_MenuButton
     */
    public function setText($value) {
    	$this->setExtConfigProperty("text", $value);
    	return $this;
    }	
       
    // DisplayMessage
    /**
     * The paging status message to display (defaults to "Displaying {0} - {1} of {2}"). Note that this string is formatted using the braced numbers 0-2 as tokens that are replaced by the values for start, end and total respectively. These tokens should be preserved when overriding this string if showing those values is desired.
     * @param string $value 
     * @return PhpExt_Toolbar_MenuButton
     */
    public function setMenu($value) {
    	$this->setExtConfigProperty("menu", $value);
    	return $this;
    }	 
    
    // DisplayMessage
    /**
     * The paging status message to display (defaults to "Displaying {0} - {1} of {2}"). Note that this string is formatted using the braced numbers 0-2 as tokens that are replaced by the values for start, end and total respectively. These tokens should be preserved when overriding this string if showing those values is desired.
     * @param string $value 
     * @return PhpExt_Toolbar_MenuButton
     */
    public function setId($value) {
    	$this->setExtConfigProperty("id", $value);
    	return $this;
    }	
	
	public function __construct() {
		parent::__construct();
		$this->setExtClassInfo("Ext.Toolbar.MenuButton", "mbutton");
	
		$validProps = array(
		    "text",
		    "id",
		    "menu"
		);
		$this->addValidConfigProperties($validProps);
	}	
	
}

